string concatenation in php

34

phpCopy<?php
$mystring1 = "This is the first string. ";
$mystring2 = "This is the second string";
$finalString = sprintf("%s %s", $mystring1, $mystring2);
echo($finalString);
?>
$data1="The colour is ";
$data2="red";

$result=$data1.$data2; // The colour is red

Comments

Submit
0 Comments